<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>解构赋值</title>
</head>
<body></body>
<script>
    //解构赋值：ES6允许按照一定模式从数组和对象中提取值，对变量进行赋值。
    //1、数组的解构
    const F4 = ['小沈阳','刘能','赵四','宋小宝']
    //把数组的元素赋值给4个变量
    let [xiao,liu,zhao,song] = F4
    console.log(xiao,liu,zhao,song)
    //2、对象的解构
    const PERSON = {name:'赵本山',age:'不详'
                ,xiaopin:function(){console.log('我会小品')}}
    let {name,age,xiaopin} = PERSON
    console.log(name,age)
    xiaopin()
</script>
</html>